#define _CRT_SECURE_NO_WARNINGS 1

#include "string.h"

namespace czb {


	void func1()
	{
		string s1("abcdefg");
		const string s2("Hello");
		const string s3(s2);
		cout << s1.c_str() << endl;
		cout << s2.c_str() << endl;
		cout << s3.c_str() << endl;
		string::iterator it = s1.begin();
		while (it != s1.end())
		{
			cout << *it;
			++it;
		}
		cout << endl;

	}

	void func2()
	{
		string s1("abcdefg");
		string s2;
		s2 = s1;
		cout << s1.c_str() << endl;
		cout << s1.size() << endl;
		cout << s1.capacity() << endl;
	}

	void func3()
	{
		string s1("123456");
		cout << s1[2]++ << endl;
		cout << s1[2] << endl;
		s1.reserve(100);
		cout << s1.capacity() << endl;
	}


	void func4()
	{
		string s1("123456");
		s1.push_back('1');
		s1.append("sdadas");
		s1 += "12345";

		cout << s1 << endl;

	}

	void func5()
	{
		string s1;
		s1.insert(0, 's');

		s1.insert(0, "asd");
		s1.insert(4, "asd");
		cout << s1 << endl;
	}

	void func6()
	{
		string s1("12345678");
		s1.erase(0,2);
		string s2("sda");
		s1.swap(s2);
		cout << s1 << endl;
		cout << s2<<endl;
	}

	void func7()
	{
		string s1("1231234");
		//cout << s1.find("1234")<<endl;
		//cout << s1.find("1")<<endl;
		//cout << s1.find("5")<<endl;
		cout << s1.substr(0, 5) << endl;
		s1.clear();
		cout << s1;
	}

	void func8()
	{
		string s1;
		string s2;
		cin >> s1>>s2;
		cout << s1<<endl;
		cout << s2<<endl;
	}

	void func9()
	{
		string s1("123456");
		string s2(s1);
		cout << s2 << endl;
		s2 = s2.substr(2);
		cout << s2 << endl;
	}

	void func10()
	{
		string s1;
	}
}

void func11()
{

	string s1;
	cout << s1<<endl;

	string s4("abcd");
	cout << s4 << endl;

	string s2(s4);
	cout << s2 << endl;

	string s3(s4,3);
	cout<<s3<<endl;

	string s5("abcd",2);
	cout << s5 << endl;

	string s6(4, 'a');
	cout << s6 << endl;

	string s7(s6.begin(),s6.end());
	cout << s7 << endl;
}

void func12()
{
	string s("1");
	cout << s<<endl;
	string s1;
	cout << s1 << endl;
}

int main()
{	
	//czb::func10();
	func12();

	return 0;
}